package com.ruoyi.supermarket.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.supermarket.mapper.OrderItemMapper;
import com.ruoyi.supermarket.domain.OrderItem;
import com.ruoyi.supermarket.service.OrderItemService;

/**
 * 订单细则Service业务层处理
 * 
 * @author 李其伟
 * @date 2023-11-14
 */
@Service
public class OrderItemServiceImpl implements OrderItemService
{
    @Autowired
    private OrderItemMapper orderItemMapper;

    /**
     * 查询订单细则
     * 
     * @param id 订单细则主键
     * @return 订单细则
     */
    @Override
    public OrderItem selectOrderItemById(Long id)
    {
        return orderItemMapper.selectOrderItemById(id);
    }

    /**
     * 查询订单细则列表
     * 
     * @param orderItem 订单细则
     * @return 订单细则
     */
    @Override
    public List<OrderItem> selectOrderItemList(OrderItem orderItem)
    {
        return orderItemMapper.selectOrderItemList(orderItem);
    }

    /**
     * 查询订单细则列表
     *
     * @param orderSns 订单编号
     * @return 订单细则集合
     */
    @Override
    public List<OrderItem> selectOrderItemByOrderSn(String[] orderSns) {
        return orderItemMapper.selectOrderItemByOrderSn(orderSns);
    }

    /**
     * 新增订单细则
     * 
     * @param orderItem 订单细则
     * @return 结果
     */
    @Override
    public int insertOrderItem(OrderItem orderItem)
    {
        return orderItemMapper.insertOrderItem(orderItem);
    }

    /**
     * 修改订单细则
     * 
     * @param orderItem 订单细则
     * @return 结果
     */
    @Override
    public int updateOrderItem(OrderItem orderItem)
    {
        return orderItemMapper.updateOrderItem(orderItem);
    }

    /**
     * 批量删除订单细则
     * 
     * @param ids 需要删除的订单细则主键
     * @return 结果
     */
    @Override
    public int deleteOrderItemByIds(Long[] ids)
    {
        return orderItemMapper.deleteOrderItemByIds(ids);
    }

    /**
     * 删除订单细则信息
     * 
     * @param id 订单细则主键
     * @return 结果
     */
    @Override
    public int deleteOrderItemById(Long id)
    {
        return orderItemMapper.deleteOrderItemById(id);
    }
}
